package com.aaa.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "time_table", schema = "trainingdb", catalog = "")
public class TimeTableEntity {
    private int subjectId;
    private String courseName;
    private String state;

    @Id
    @Column(name = "subject_id")
    public int getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(int subjectId) {
        this.subjectId = subjectId;
    }

    @Basic
    @Column(name = "course_name")
    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    @Basic
    @Column(name = "state")
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TimeTableEntity that = (TimeTableEntity) o;
        return subjectId == that.subjectId &&
                Objects.equals(courseName, that.courseName) &&
                Objects.equals(state, that.state);
    }

    @Override
    public int hashCode() {
        return Objects.hash(subjectId, courseName, state);
    }
}
